package com.scs.application.modules.finance.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.scs.application.core.entity.FlowEntity;
import com.scs.application.modules.upgrade.db.annotation.EntityClassAnnotation;
import com.scs.application.modules.upgrade.db.annotation.EntityFieldAnnotation;
import com.scs.application.modules.upgrade.db.enums.EntityFieldType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * <p>
 * 开票单
 * </p>
 */
@Data
@Accessors(chain = true)
@EntityClassAnnotation(remark = "发票单表")
@TableName("finance_invoice")
public class Invoice extends FlowEntity {


    // id ,在父类中处理

    @EntityFieldAnnotation(
            text = "关联id",
            length = "50",
            default_value = "",
            comment = ""
    )
    private String refId;

    @EntityFieldAnnotation(
            text = "单号",
            length = "20",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String code;

    @EntityFieldAnnotation(
            text = "供应商ID",
            type = EntityFieldType.LONG,
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String supplierId;

    @EntityFieldAnnotation(
            text = "供应商名称",
            length = "100",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String supplierName;

    @EntityFieldAnnotation(
            text = "开始时间",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private Date gmtStart;

    @EntityFieldAnnotation(
            text = "结束时间",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private Date gmtEnd;

    @EntityFieldAnnotation(
            text = "开票时间",
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private Date gmtMakeOut;

    @EntityFieldAnnotation(
            text = "开票人",
            length = "50",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String drawer;

    @EntityFieldAnnotation(
            text = "开票金额",
            length = "18,4",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private Double totalAmount;

    @EntityFieldAnnotation(
            text = "税务发票号",
            length = "200",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String invoiceNo;

    @EntityFieldAnnotation(
            text = "备注",
            length = "100",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String remark;

    @EntityFieldAnnotation(
            text = "期号",
            length = "20",
            not_null = true,
            default_value = "无",
            comment = ""
    )
    private String periodNo;

    @TableField(exist = false)
    private String hrpKey;

}
